package com.tm.servicemsm.controller;
/**
 * 2024/7/20 用户提交身份信息和银行卡信息来绑定个人信息，调用汇付宝支付接口提交绑定信息并设置支付密码，使用阿里 云SMS短信服务和异步回调返回通知用户绑定结果
 */
public class AlipayBindingExample {
    public static void main(String[] args) {
        //获取用户提供的信息
        String userId="用户ID";
        String userName="用户姓名";
        String idNumber="用户身份证号";
        String bankCardNumber="用户银行卡号";

        //创建AlipayClient,需要传入API地址 APPID RSA2私钥等
       /*AlipayClient alipayClient= new DefaultAlipayClient("https://openapi.alipay.com/gatway.do",
                "应用APPID","应用私钥","json","UTF-8","支付宝公钥");*/

      //创建API请求并设置参数
/*        AlipayFundAccountBindToaccountOrderAppRequest request = new AlipayFundAccountBindToaccountOrderAppRequest();
        // 设置用户信息和银行卡信息
        request.setBizContent("{" +
                "\"out_order_no\":\"2018090100000000000000000000\"," +
                "\"identity_type\":\"CARD\"," +
                "\"identity_info\":\"身份证号\"," +
                "\"account_name\":\"用户姓名\"," +
                "\"bank_card_no\":\"银行卡号\"," +
                "\"mobile\":\"手机号码\"," +
                "\"identity_params\":{" +
                "\"identity_type\":\"IDENTITY_CARD\"," +
                "\"identity_info\":\"身份证号\"" +
                "}" +
                "}");

        // 发送请求并获取响应
        try {
            AlipayFundAccountBindToaccountOrderAppResponse response = alipayClient.execute(request);
            // 处理响应，例如检查response.isSuccess()
            System.out.println(response.getBody());
        } catch (AlipayApiException e) {
            e.printStackTrace();
        }*/

    }
}
